package ar.com.fiuba.domain.impl;


import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;

import ar.com.fiuba.application.impl.FileDataSource;
import ar.com.fiuba.domain.api.ErrorGenerator;

public class ErrorGeneratorInsertion extends ErrorGenerator {
	

	public ErrorGeneratorInsertion(String inputFileName, int numberOfWords)
	{
		super(inputFileName, numberOfWords);
	}
	
	
	public ArrayList<String> generateErrorAtTheBeginning()
	{
		ArrayList<String> wordsWithError = new ArrayList<String>();
			  for(String s:correctWordsArray){		  
				  String aux=s;
				  wordsWithError.add("e" + aux );
			  }			  
		return wordsWithError;	  
	}
	
	public ArrayList<String> generateErrorAtTheEnd()
	{
		ArrayList<String> wordsWithError = new ArrayList<String>();
			  for(String s:correctWordsArray){		  
				  String aux=s;
				  wordsWithError.add(aux + "e" );
			  }			  
		return wordsWithError;	  
	}
	
	public ArrayList<String> generateErrorInTheMiddle()
	{
		ArrayList<String> wordsWithError = new ArrayList<String>();
			  for(String s:correctWordsArray){		  
				  String aux=s;
				  wordsWithError.add(aux.substring(0,2) + "e" + aux.substring(2,aux.length()) );
			  }			  
		return wordsWithError;	  
	}
	
	
	
}
